<!--
 * @Author: 熔岩巨兽 2141826215@qq.com
 * @Date: 2024-08-27 22:13:57
 * @LastEditTime: 2024-08-27 23:28:04
 * @LastEditors: 熔岩巨兽 2141826215@qq.com
 * @FilePath: \vue-vite-project\src\views\CommunicationMode\customEvent\customEvent.vue
 * Copyright (c) 2024 by 熔岩巨兽 2141826215@qq.com, All Rights Reserved. 
-->
<template>
  <div class="customEvent_warpper">
    <h1>我是父组件页面</h1>
  </div>
  <Event1 @event1="event1" />
  <Event2 @event2="event2" @click="domClick" />
</template>

<script lang="ts" setup name="customEvent">
import Event1 from "./event1.vue";
import Event2 from "./event2.vue";
import { ref } from "vue";
const event1 = (info: string) => {
  console.log(info);
};
const event2 = (callback: Function) => {
  callback("event2事件Click的回调函数");
};
const domClick = () => {
  console.log("我是domClick");
};
</script>

<style scoped>
.customEvent_warpper {
  width: 100%;
  color: #000;
  background-color: rgb(44, 104, 84);
}
</style>
